import React from 'react';
import { Router, Route, IndexRedirect } from 'react-router';


import ADVICE_PAGE from 'Page/AdivcePage';
import SELECT_BUSINESS from 'Page/SelectBusiness';
import UPLOAD_ATTACHMENT_PAGE from 'Page/UploadAttachmentPage';
// 日常工作
import NORMAL_WORK from 'Page/NormalWork';
import NORMAL_WORK_DETAIL_PAGE from 'Page/NormalWork/DetailPage';

import VR_PAGE from 'Page/VRPage';
import VR_DETAIL_PAGE from 'Page/VRPage/VrDetail';

import VIDEO_PAGE from 'Page/VideoPage';
import VIDEO_DETAIL_PAGE from 'Page/VideoPage/VideoDetail';

import RUN_ONCE_PAGE from 'Page/RunOncePage';
import RUN_ONCE_DETAIL_PAGE from 'Page/RunOncePage/processDetail';

import COMPLAINT_PAGE from 'Page/InteractivePage/ComplaintPage';
import COMPLAINT_DETAIL_PAGE from 'Page/InteractivePage/ComplaintPage/ComplaintDetail';
import DOUBLE_PAGE from 'Page/InteractivePage/DoublePage';
import DOUBLE_DETAIL_PAGE from 'Page/InteractivePage/DoublePage/DoubleDetail';
import SPEAK_PAGE from 'Page/InteractivePage/SpeakPage';
import SPEAK_DETAIL_PAGE from 'Page/InteractivePage/SpeakPage/SpeakDetail';
import EXAM_PAGE from 'Page/InteractivePage/ExamPage';
import EXAM_LOGIN_PAGE from 'Page/InteractivePage/ExamPage/ExamLogin';
import EXAM_DETAIL_PAGE from 'Page/InteractivePage/ExamPage/ExamDetail';

import MAP_PAGE from 'Page/ShiAnMap';
import MAP_SEARCH_PAGE from 'Page/ShiAnMap/MapSearch';

import NAVIGATION_PAGE from 'Page/NavigationPage';
import NAVIGATION_SEARCH_PAGE from 'Page/NavigationPage/NavigationSearch';
import NAVIGATION_DETAIL_PAGE from 'Page/NavigationPage/OrganiseDetail';

import { history } from '../store/configureStore';
import PageContainer from '../containers/PageContainer';
import InformPage from '../components/Page/InformPage';
import AppointmentPage from '../components/Page/AppointmentPage';
// 指挥调度反馈信息
import FEEDBACK from '../components/FeedbackMessage';


import { validate } from './enterHandles';

class DevRoute extends React.PureComponent {
  render() {
    return (
      <Router history={history}>
        <Route path="/" onEnter={validate} component={PageContainer}>
          <IndexRedirect to="/feedback" />
          <Route path="/advice" component={ADVICE_PAGE} />
          <Route path="/inform" component={InformPage} />
          <Route path="/appointment" component={AppointmentPage} />
          <Route path="/select_business" components={SELECT_BUSINESS} />
          <Route path="/attach" component={UPLOAD_ATTACHMENT_PAGE} />
          <Route path="/feedback" component={FEEDBACK} />
          {/* 日常工作 */}
          <Route path="/normal_work" component={NORMAL_WORK} />
          <Route path="/normal_work/detail/:id" component={NORMAL_WORK_DETAIL_PAGE} />
          {/* VR */}
          <Route path="/vr" component={VR_PAGE} />
          <Route path="/vr/detail/:id" component={VR_DETAIL_PAGE} />
          {/* 食安科普 */}
          <Route path="/video" component={VIDEO_PAGE} />
          <Route path="/video/detail/:id" component={VIDEO_DETAIL_PAGE} />
          {/* 最多跑一次 */}
          <Route path="/run_once" component={RUN_ONCE_PAGE} />
          <Route path="/run_once/detail/:id" component={RUN_ONCE_DETAIL_PAGE} />
          {/* 投诉举报 */}
          <Route path="/complaint" component={COMPLAINT_PAGE} />
          <Route path="/complaint/detail/:id" component={COMPLAINT_DETAIL_PAGE} />
          {/* 你点我检双随机 */}
          <Route path="/double" component={DOUBLE_PAGE} />
          <Route path="/double/detail/:id" component={DOUBLE_DETAIL_PAGE} />
          {/* 建言 */}
          <Route path="/speak" component={SPEAK_PAGE} />
          <Route path="/speak/detail/:id" component={SPEAK_DETAIL_PAGE} />
          {/* 测评 */}
          <Route path="/exam" component={EXAM_PAGE} />
          <Route path="/exam/login" component={EXAM_LOGIN_PAGE} />
          <Route path="/exam/login/detail/:examId/:userId" component={EXAM_DETAIL_PAGE} />
          {/* 食安地图 */}
          <Route path="/map" component={MAP_PAGE} />
          <Route path="/map/search" component={MAP_SEARCH_PAGE} />
          {/* 导航 */}
          <Route path="/navigation" component={NAVIGATION_PAGE} />
          <Route path="/navigation/search" component={NAVIGATION_SEARCH_PAGE} />
          <Route path="/navigation/detail/:id" component={NAVIGATION_DETAIL_PAGE} />
        </Route>
      </Router>
    );
  }
}

export default DevRoute;
